package cn.tedu.ivos.user.satoken;

import cn.dev33.satoken.stp.StpInterface;
import cn.tedu.ivos.user.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<String> getPermissionList(Object loginId, String s) {
        Long userId = Long.valueOf(loginId.toString());
        return userMapper.selectPermsByUserId(userId);
    }

    @Override
    public List<String> getRoleList(Object loginId, String s) {
        return Collections.emptyList();
    }
}
